
#include "slepdef.h"
#include <stdio.h>




void printSlepMatrix(slep_matrix *mtrx){
	int i, j, k;
	if(mtrx->sparsity == SlepDense){
		printf("\n The dense matrix is printed below\n");
		for(i=0;i < mtrx->m; i++){
			for(j=0 ; j < mtrx->n; j++)
				printf("%lf ",(mtrx->data.mtrx)[ i + j * mtrx->m ]);
			printf("\n");
		}
	}else{
		printf("\n The sparse matrix is printed below\n");
		if(mtrx->data.spmtrx.format ==  SlepCompressedSparseColumn)
			for(i=0; i < (mtrx->n); i++)
				for(j=mtrx->data.spmtrx.Index[i];j<mtrx->data.spmtrx.Index[i+1];j++){
					k=mtrx->data.spmtrx.ColumnsORRows[j];
					printf("(%d,%d)->%lf\n",k,i,mtrx->data.spmtrx.values[j]);
				}
		else if(mtrx->data.spmtrx.format ==  SlepCompressedSparseRow)
			for(i=0; i < (mtrx->m); i++)
				for(j=mtrx->data.spmtrx.Index[i];j<mtrx->data.spmtrx.Index[i+1];j++){
					k=mtrx->data.spmtrx.ColumnsORRows[j];
					printf("(%d,%d)->%lf\n",i,k,mtrx->data.spmtrx.values[j]);
				}
	}
}